Conversation
rolfbjarne
left a comment
There was a problem hiding this comment.
Let's wait with this until the dependent pull requests have been merged.
41e896c to
9f9d756
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds AppleInstaller, an orchestrator class that drives Apple development environment setup by running EnvironmentChecker, installing missing Command Line Tools, triggering Xcode first-launch packages, and downloading simulator runtimes for requested platforms. It also adds EnvironmentChecker (aggregates results from CommandLineTools, XcodeManager, and RuntimeService) and refactors CommandLineTools.cs to use a file-scoped namespace and adds missing InvalidOperationException catch clauses. Tests are added for both EnvironmentChecker and AppleInstaller.
Changes:
- New
Xamarin.MacDev/EnvironmentChecker.csimplementing environment state aggregation, license checking, first-launch, and platform detection - New
Xamarin.MacDev/AppleInstaller.csorchestrating CLT installation, first-launch, and runtime downloads with dry-run support - New test files
tests/EnvironmentCheckerTests.csandtests/AppleInstallerTests.cs, plus a namespace+catch-clause fix toCommandLineTools.cs
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
Xamarin.MacDev/EnvironmentChecker.cs |
New class: aggregates Xcode, CLT, runtime, and platform checks; exposes IsXcodeLicenseAccepted(), RunFirstLaunch(), and MapPlatformName() |
Xamarin.MacDev/AppleInstaller.cs |
New class: orchestrates environment setup, delegates to EnvironmentChecker, CommandLineTools, and RuntimeService with dry-run support |
Xamarin.MacDev/CommandLineTools.cs |
Refactored to file-scoped namespace; added InvalidOperationException catch in GetCommandLineToolsPath and GetVersionFromPkgutil |
tests/EnvironmentCheckerTests.cs |
10 parameterised tests for MapPlatformName covering all known platform name mappings |
tests/AppleInstallerTests.cs |
Constructor null-check test + 5 DeriveStatus tests (largely duplicated from EnvironmentCheckResultTests.cs) |
You can also share your feedback on Copilot code review. Take the survey.
- Add AppleInstaller class that orchestrates environment setup: checks state via EnvironmentChecker, installs CLT, triggers first-launch packages, and downloads simulator runtimes - Add InvalidOperationException catch clauses to CommandLineTools GetCommandLineToolsPath and GetVersionFromPkgutil - Address review feedback: use static readonly for paths, log DownloadPlatform failures, remove duplicate DeriveStatus tests - Tests: constructor null-check + macOS smoke tests (dry-run) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
9f9d756 to
5f2f704
Compare
Apple Install Orchestrator
Adds
AppleInstaller, an orchestrator class that drives Apple development environment setup.What it does
EnvironmentChecker.Check()to assess current statexcode-select --install)xcodebuild -runFirstLaunch)Supports
dryRunmode that reports what would happen without making changes.Changes
Xamarin.MacDev/AppleInstaller.csXamarin.MacDev/CommandLineTools.csInvalidOperationExceptioncatch clauses toGetCommandLineToolsPathandGetVersionFromPkgutiltests/AppleInstallerTests.csAPI Surface
Review Feedback Addressed
xcodeSelectPathusesstatic readonlyinstead ofconst(matches codebase convention)DownloadPlatformreturn value is now checked and logged on failureDeriveStatustests (already covered by EnvironmentCheckResultTests)using System.Linqnot presentTests
Dependencies